#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	char str[100];
	int letter, num, space, other;
	letter = num = space = other = 0;
	scanf("%[^\n]", str);
	for (int i = 0; i < strlen(str); i++)
	{
		if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z'))letter++;
		else if (str[i] >= '0' && str[i] <= '9')num++;
		else if (str[i] == ' ')space++;
		else other++;
	}
	cout << letter << " " << num << " " << space << " " << other << endl;
	return 0;
}